package com.junzhiit.nengji.api.web.vo;

import com.bainaeco.framework.base.BaseObject;

public class DataTablesParamVO extends BaseObject{
	
	private static final long serialVersionUID = 990067209896973539L;

	private Integer start = 0;// query start index.
	
	private Integer length = 10;// show number
	
	private Integer page = 1; // this page
	
	private Integer draw = 1;// this draw.
	
	private String sortName;
	
	private String sortType;

	public Integer getStart() {
		return start;
	}

	public void setStart(Integer start) {
		this.start = start;
	}

	public Integer getLength() {
		return length;
	}

	public void setLength(Integer length) {
		this.length = length;
	}

	public Integer getPage() {
		return page;
	}

	public void setPage(Integer page) {
		this.page = page;
	}

	public Integer getDraw() {
		return draw;
	}

	public void setDraw(Integer draw) {
		this.draw = draw;
	}

	public String getSortName() {
		return sortName;
	}

	public void setSortName(String sortName) {
		StringBuilder fieldName = new StringBuilder();
		for(int i=0,len= sortName.length(); i< len;i++){
			char c = sortName.charAt(i);
			if(Character.isLowerCase(c)){
				fieldName.append(c);
			}else{
				fieldName.append("_").append(c);
			}
		}
		sortName = fieldName.toString().toLowerCase();
		this.sortName = sortName;
	}

	public String getSortType() {
		return sortType;
	}

	public void setSortType(String sortType) {
		this.sortType = sortType;
	}

}
